//
// Created by wyh on 2024/4/20.
//

#include <iostream>
#include <xml/parser.h>
#include "xml/xml.h"

using namespace std;
using namespace wyh::xml;

int main(int argc, char **argv) {
    Xml x;
    x.name("students");

    Xml c1("student");
    c1.text("c1");
    Xml c2("student");
    c2.text("c2");
    Xml c3("student");
    c3.text("c3");

    x.append(c1);
    x.append(c2);
    x.append(c3);

//    x.remove(0);
//
//    cout << x << endl;

//    for (auto it = x.begin(); it != x.end(); ++it)
//    {
//        cout << *it << endl;
//    }

    Xml e = x;

    e.name("e");

    cout << e << endl;
    cout << x << endl;

    x.save("./../test.xml");

    cout<<"---------------------------"<<endl;

    Xml x1;
    x1.load("./../test.xml");
    cout<<x1<<endl;

    return 0;
}
